Pro Java 7 NIO.2 by Anghel Leonard
Author:Anghel Leonard [Leonard, Anghel]
Language: eng
Format: epub, pdf
ISBN: 9781430240112
Publisher: Apress
Published: 2011-11-28T05:00:00+00:00
Figure 7-3 Java buffer representation (c)
Next, suppose that we read 2 bytes of data into our buffer. The 2 bytes of data go into the buffer starting at position 0. Therefore, the first 2 bytes are filled and the position goes to the third byte, as shown in Figure 7-4.
Figure 7-4 Java buffer representation (d)
Continuing with a second read, another 3 bytes go into the buffer. The position is increased to 5 (slot 6), as you can see in Figure 7-5.
Figure 7-5 Java buffer representation (e)
At this point, suppose that we are not reading into the buffer anymore and want to write from the buffer. To do this, we first need to call the flip() method before we write any bytes. This will set the limit to the current position, and set the position to 0. After the flip, the buffer appears as shown in Figure 7-6.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(21660)
Hello! Python by Anthony Briggs(20890)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(19357)
Dependency Injection in .NET by Mark Seemann(18940)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(18565)
Kotlin in Action by Dmitry Jemerov(18354)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(18164)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(17026)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(16948)
Grails in Action by Glen Smith Peter Ledbrook(16143)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(13827)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(11830)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(10650)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10590)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(9754)
Hit Refresh by Satya Nadella(9099)
The Kubernetes Operator Framework Book by Michael Dame(8534)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8358)
Robo-Advisor with Python by Aki Ranin(8302)